home *** CD-ROM | disk | FTP | other *** search
- /************************************************
- timeoday.c
-
- gettimeofday replacement
- Note that it ignores the timezone parameter
-
- by Peter Tan
- ************************************************/
- #include <timeval.h>
- #include <sys\timeb.h>
-
- int gettimeofday(struct timeval *tv, struct timezone *tz)
- {
- struct timeb buf;
-
- ftime(&buf);
-
- if (tv) {
- tv->tv_sec=buf.time;
- tv->tv_usec=buf.millitm;
- }
- if (tz) {
- tz->tz_minuteswest=buf.timezone;
- tz->tz_dsttime=buf.dstflag;
- }
- return 0;
- }